const Singleton = (function () {
  let _instance = null;
  function Single() {
    return {
      name: "single",
      value: 111,
    };
  }
  return function () {
    if (!_instance) {
      _instance = Single();
      console.log(_instance);
    }
    return _instance;
  };
})();

let single = Singleton();
console.log(single.name);
let single2 = Singleton();
console.log(single === single2); // true
